package org.example.spring.controller.User;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.example.spring.domain.pojo.Result;
import org.example.spring.service.CheckoutService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "结算相关接口")
@RestController
@RequestMapping("/user/checkout")
public class CheckoutController {

    @Autowired
    private CheckoutService checkoutService;

    @ApiOperation("结算")
    @RequestMapping("/pay")
    public Result pay(@RequestParam Integer orderId) {
        checkoutService.pay(orderId);
        return Result.success();
    }

}
